package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    /**
     * 删除菜品
     * @param dishIds
     * @return
     */
    //select * from setmeal_dish where id in (1,2,3,4)
    List<Long> getSetmealIdsByDishIds(List<Long> dishIds);

    /**
     * 向套餐菜品中插入n条菜品数据(批量添加菜品数据)
     * @param dishes
     */
    void insertBatch(List<SetmealDish> dishes);

    /**
     * 删除套餐菜品表中关联的菜品数据
     * @param setmealId
     */
    @Delete("delete from setmeal_dish where setmeal_id = #{setmealId}")
    void deleteBySetmealId(Long setmealId);
}
